//
//  TabBarViewController.m
//  safeLady
//
//  Created by Justsoso on 2017/7/3.
//  Copyright © 2017年 xmy. All rights reserved.
//

#import "TabBarViewController.h"


@interface TabBarViewController ()

@property (nonatomic, strong) UIButton *left_menu;
@end

@implementation TabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    /* 隐藏 */
//    [self.navigationController.navigationBar setHidden:YES];
//    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
//    self.title = @"状态";
    
    
    
//    self.viewControllers = [self rootViewControllers];
    
//    [self setCenterButton];

}

//-(void)setCenterButton{
//    self.left_menu = [UIButton buttonWithType:UIButtonTypeCustom];
//    [self.left_menu setImage:[UIImage imageNamed:@"个人中心"]  forState:UIControlStateNormal];
//    [self.left_menu setFrame:CGRectMake(0, 0, 35, 44)];
//    [self.left_menu addTarget:self action:@selector(showUserCenter:) forControlEvents:UIControlEventTouchUpInside];
//    UIBarButtonItem*userHeadItem = [[UIBarButtonItem alloc] initWithCustomView:self.left_menu];
//    [self.navigationItem setLeftBarButtonItem:userHeadItem animated:YES];
//}

- (NSMutableArray *)rootViewControllers {
    
    
    NSMutableArray* vctArray = [NSMutableArray array];
    UIViewController *stateVC = [[UIStoryboard storyboardWithName:@"State" bundle:nil] instantiateInitialViewController];
    stateVC.view.backgroundColor = [UIColor whiteColor];
    stateVC.tabBarItem.title = @"状态";
    stateVC.tabBarItem.image = [[UIImage imageNamed:@"tab_state_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    stateVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"tab_state_selection"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [stateVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:0xDDC055 alpha:1]} forState:UIControlStateSelected];
    //    stateVC.title = @"状态";
    [vctArray addObject:stateVC];
    
    UIViewController *hookVC = [[UIStoryboard storyboardWithName:@"Community" bundle:nil] instantiateInitialViewController];
    hookVC.view.backgroundColor = [UIColor whiteColor];
    hookVC.tabBarItem.title = @"社区";
    hookVC.tabBarItem.image = [[UIImage imageNamed:@"tab_community_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    hookVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"tab_community_selection"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [hookVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:0xDDC055 alpha:1]} forState:UIControlStateSelected];
    [vctArray addObject:hookVC];
    
    
    UIViewController *foundVC = [[UIStoryboard storyboardWithName:@"Found" bundle:nil] instantiateInitialViewController];
    foundVC.view.backgroundColor = [UIColor whiteColor];
    foundVC.tabBarItem.title = @"发现";
    foundVC.tabBarItem.image = [[UIImage imageNamed:@"tab_found_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    foundVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"tab_found_selection"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [foundVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:0xDDC055 alpha:1]} forState:UIControlStateSelected];
    [vctArray addObject:foundVC];
    
    UIViewController *mineVC = [[UIStoryboard storyboardWithName:@"PaWu" bundle:nil] instantiateInitialViewController];
    mineVC.view.backgroundColor = [UIColor whiteColor];
    mineVC.tabBarItem.title = @"啪物";
    mineVC.tabBarItem.image = [[UIImage imageNamed:@"tab_mine_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    mineVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"tab_mine_selection"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [mineVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:0xDDC055 alpha:1]} forState:UIControlStateSelected];
    [vctArray addObject:mineVC];
    
    return vctArray;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
